/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package vmcs.controller.statePattern;

/**
 *
 * @author Eileen
 */ 
class DrinkSelectionState extends VmcsState {    
    DrinkSelectionState(TransactionController fsm){
        this.m_fsm = fsm;
    }
    @Override
    public void OnSelectDrink() {
        System.out.println("DrinkSelectionState::On Select drink");
        m_fsm.changeState(TransactionController.COIN_RECV);
        m_fsm.setActivateCoinPanel(true);
        m_fsm.setDrinkDispense(null);
        m_fsm.setRefundAmount( 0 );
    }    
    @Override
    public void OnTerminate() {
        System.out.println("DrinkSelectionState::On terminate");
        m_fsm.getState(TransactionController.TERMINATE).OnTerminate();
        m_fsm.setActivateCoinPanel(true);
        m_fsm.setActivateCoinPanel(false);
    }    
    @Override
    public void OnGiveChange(){
        System.out.println("DrinkSelectionState::On give change! Throw exception!");
    }    
    @Override
    public void OnDispenseDrink() {
        System.out.println("DrinkSelectionState::On dispense drink! Throw exception!");
    }
    @Override
        public void OnMaintenance() {
        System.out.println("DrinkSelectionState::On Maintenance mode");
        boolean bMaintain = m_fsm.getMaintenanceFlag();
        if(bMaintain){
            m_fsm.setActivateDrinkPanel(false);
            m_fsm.setActivateCoinPanel(false);
        }
        else{
            m_fsm.setActivateDrinkPanel(true);
            m_fsm.setActivateCoinPanel(false);            
        }
    }
    @Override
    public void OnReceiveCoin() {
        System.out.println("DrinkSelectionState::On Receive Coin! Throw exception!");
    }
    @Override
    public void OnStoreCoin() {
        System.out.println("DrinkSelectionState::On Receive Coin! Throw exception!");
    }
}
